/**
 * Copyright (c) 2006 RiseSoft Co.,Ltd  
 * $Header$
 */
package cn.newtest.bi.collection.service;

import java.util.List;
import java.util.Map;

import net.risesoft.risebi.collection.model.Catalog;
import net.risesoft.risebi.collection.model.RangeObj;
import net.risesoft.risebi.collection.model.ReportData;
import net.risesoft.risebi.collection.model.ReportInstance;
import net.risesoft.risebi.collection.model.TemplateIndication;
import net.risesoft.risebi.collection.model.TemplateRange;
import net.risesoft.risebi.collection.model.User;

import org.appfuse.service.Manager;
import org.hibernate.SessionFactory;

/**
 *
 *
 * @author <a href="mailto: chenjian@risesoft.net">陈健</a>
 * @version $Revision$
 * 
 */
public interface DataOperationManager extends Manager {

	ReportData getReportData(ReportInstance ri,String templateGuid) throws Exception;
	
	ReportData getBaseInfoData(String soInstanceGuid,String tableName,String templateGuid) throws Exception;
	
	Map addReportData(ReportInstance ri,ReportData rd,String templateGuid,User user) throws Exception;
	Map addReportData(ReportInstance ri,ReportData rd,String templateGuid,List<TemplateIndication> templateIndicationList,Map<String,TemplateIndication> templateIndicationMap,Map<String,Map<String,String>> rangeColumnCodeMap,User user,boolean needValidate,boolean needAudit,boolean needSendMessage,boolean fromImp,boolean needSkip,Map<String,TemplateRange> templateRangeMap,List<TemplateRange> templateRangeList) throws Exception;
	
	Map addBaseInfoData(Catalog so,ReportData rd,String templateGuid,User user) throws Exception;
	
	void removeData(String reportInstanceGuid,User user) throws Exception;
	
	/**
	 * 组建每个range中对应的catalogName
	 * 
	 * @param templateGuid
	 * @return
	 * @throws Exception
	 */
	public Map<String,String> makeRangeCatalogName(String templateGuid) throws Exception;
	

	public Map<String,List<String>> makeRangeSortedCotalogCodeMap(Map<String,RangeObj> ranges) throws Exception;
	
}
